package com.design_patterns.composite;

import java.util.ArrayList;
import java.util.List;

/**
 * @author: 李德才
 * @description:
 * @create: 2020-08-29 13:36
 **/
public class FolderNode extends Node {

    public String name;

    public FolderNode(String name) {
        this.name = name;
    }

    public List<Node> nodeList = new ArrayList<>();

    @Override
    public void printMe() {
        System.err.println(name);
    }

    public List<Node> getNodeList() {
        return nodeList;
    }

    public FolderNode addNode(Node node) {
        this.nodeList.add(node);
        return this;
    }
}
